package com.forum.module.system.api.oauth2.dto;

import io.swagger.v3.oas.annotations.media.Schema;

import java.time.LocalDateTime;

/**
 * @author zihan.ouyang
 */
@Schema(description = "微服务 - OAuth2 访问令牌 Response DTO")
public class OAuth2AccessTokenRespDTO {
    @Schema(description = "访问令牌", requiredMode = Schema.RequiredMode.REQUIRED, example = "skdjglsdkfjglskdfjgl")
    private String accessToken;

    @Schema(description = "刷新令牌", requiredMode = Schema.RequiredMode.REQUIRED, example = "sdfsdfsdfsdf")
    private String refreshToken;

    @Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    private Long userId;

    /**
     * 用户类型
     * <p>
     * {@link com.forum.framework.common.enums.UserTypeEnum}
     */
    @Schema(description = "用户类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    private Integer userType;

    @Schema(description = "过期时间", requiredMode = Schema.RequiredMode.REQUIRED)
    private LocalDateTime expiresTime;

    public String getAccessToken() {
        return accessToken;
    }

    public OAuth2AccessTokenRespDTO setAccessToken(String accessToken) {
        this.accessToken = accessToken;
        return this;
    }

    public String getRefreshToken() {
        return refreshToken;
    }

    public OAuth2AccessTokenRespDTO setRefreshToken(String refreshToken) {
        this.refreshToken = refreshToken;
        return this;
    }

    public Long getUserId() {
        return userId;
    }

    public OAuth2AccessTokenRespDTO setUserId(Long userId) {
        this.userId = userId;
        return this;
    }

    public Integer getUserType() {
        return userType;
    }

    public OAuth2AccessTokenRespDTO setUserType(Integer userType) {
        this.userType = userType;
        return this;
    }

    public LocalDateTime getExpiresTime() {
        return expiresTime;
    }

    public OAuth2AccessTokenRespDTO setExpiresTime(LocalDateTime expiresTime) {
        this.expiresTime = expiresTime;
        return this;
    }
}
